<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>首页</title>
    <!--引入样式-->
    <link rel="stylesheet" href="../style/element-ui/index.css">
<head>
<body>
<template>
    <div>
        <el-row :gutter="15">
            <el-form ref="elForm" :model="formData" :rules="rules" size="medium" label-width="100px">
                <el-col :span="12">
                    <el-form-item label="秘钥" prop="field101">
                        <el-input v-model="formData.field101" placeholder="请输入秘钥" clearable
                                  prefix-icon='el-icon-s-custom'
                                  :style="{width: '100%'}"></el-input>
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="店铺ID" prop="field102">
                        <el-input v-model="formData.field102" placeholder="请输入店铺ID" clearable
                                  prefix-icon='el-icon-platform-eleme' :style="{width: '100%'}"></el-input>
                    </el-form-item>
                </el-col>
                <el-col :span="24">
                    <el-form-item label="日期范围" prop="field107">
                        <el-date-picker type="datetimerange" v-model="formData.field107" format="yyyy-MM-dd HH:mm:ss"
                                        value-format="yyyy-MM-dd HH:mm:ss" :style="{width: '100%'}"
                                        start-placeholder="开始日期"
                                        end-placeholder="结束日期" range-separator="至" clearable></el-date-picker>
                    </el-form-item>
                </el-col>
                <el-col :span="24">
                    <el-form-item size="large">
                        <el-button type="primary" @click="submitForm">提交</el-button>
                        <el-button @click="resetForm">重置</el-button>
                    </el-form-item>
                </el-col>
            </el-form>
        </el-row>
    </div>
</template>
<script>
    export default {
        components: {},
        props: [],
        data() {
            return {
                formData: {
                    field101: undefined,
                    field102: undefined,
                    field107: ["2024-04-26 00:00:00", "2024-04-26 00:00:00"],
                },
                rules: {
                    field101: [{
                        required: true,
                        message: '请输入秘钥',
                        trigger: 'blur'
                    }],
                    field102: [{
                        required: true,
                        message: '请输入店铺ID',
                        trigger: 'blur'
                    }],
                    field107: [{
                        required: true,
                        type: 'array',
                        message: '请至少选择一个日期范围',
                        trigger: 'change'
                    }],
                },
            }
        },
        computed: {},
        watch: {},
        created() {
        },
        mounted() {
        },
        methods: {
            submitForm() {
                this.$refs['elForm'].validate(valid => {
                    if (!valid) return
                    // TODO 提交表单
                })
            },
            resetForm() {
                this.$refs['elForm'].resetFields()
            },
        }
    }

</script>
<style>
</style>
</body>


